8  Online Appendix A

8.1 Setup

8.1.1 Install Packages

We install the following packages using the groundhog package manager to increase computational reproducibility.

options(repos = c(CRAN = "https://cran.r-project.org")) 

if (!requireNamespace("groundhog", quietly = TRUE)) {
    install.packages("groundhog")
}

pkgs <- c("magrittr", "data.table", "stringr", "Rmisc", "ggplot2")

groundhog::groundhog.library(pkg = pkgs,
                             date = "2024-08-01")

rm(pkgs)

8.1.2 Read Data

data      <- readRDS(file="../data/processed/full.Rda")
timeSpent <- data.table::fread(file = "../data/raw/PageTimes-2021-09-15.csv")
raw       <- data.table::fread(file="../data/raw/all_apps_wide_2021-09-15.csv")

8.1.3 Design

We define some design features in the following:

colors <- c("#F3B05C", "#1E4A75", "#65B5C0", "#AD5E21")

layout <- theme(panel.background = element_rect(fill = "white"),
                legend.key = element_rect(fill = "white"),
                panel.grid.major.y = element_line(colour = "grey", 
                                                  linewidth = 0.25),
                axis.ticks.y = element_blank(),
                panel.grid.major.x = element_blank(),
                axis.line.x.bottom = element_line(colour = "#000000", 
                                                  linewidth = 0.5),
                axis.line.y.left = element_blank(),
                plot.title = element_text(size = rel(1))
)

8.2 Figure OA1

timeSpent[,
          lag := shift(epoch_time_completed, fill = NA, type = "lag"),
          by = c("session_code", "participant_code")]
timeSpent[,
          duration := epoch_time_completed - lag,
          by = c("session_code", "participant_code")]
timeSpent[,
          completion := epoch_time_completed %>% max() - epoch_time_completed %>% min(),
          by = c("session_code", "participant_code")]

duration <- timeSpent[participant_code %in% data$participant.code,
                      .(
                        session_code,
                        participant_code,
                        app_name,
                        page_name,
                        page_index,
                        page_submission = epoch_time_completed,
                        time_spent = duration,
                        completion_time = completion
                      )]


N <- duration[, participant_code %>% unique() %>% length()]

tmp <- duration[app_name == "Baillon" & page_name == "Baillon_Decision",
                 .(time_spent = time_spent %>% sum()),
                 by = c("session_code", "participant_code", "page_index", "page_name")]

tmp[, round := page_index-2, by = c("participant_code")]

# remove outliers
plotDT <- tmp[,
               .SD[time_spent < quantile(time_spent, probs = 0.99)],
               by = page_index]

ggplot(data = summarySE(data = plotDT,
                        measurevar = "time_spent",
                        groupvars=c("round"),
                        na.rm = FALSE,
                        conf.interval = 0.95,
                        .drop = TRUE),
       mapping = aes(x = round, y = time_spent)) +
  geom_hline(yintercept = 0) +
  layout +
  theme(legend.position="bottom") +
  geom_line(show.legend=FALSE, color = colors[2], lty=2) +
  geom_errorbar(aes(ymin=time_spent-ci, ymax=time_spent+ci), width=.25, alpha = 0.5, color = colors[3]) +
  geom_point(color = colors[2]) +
  scale_x_continuous(name="", breaks = 1:12) +
  scale_y_continuous(limits = c(0, NA), expand = c(0, 0),
                     breaks = c(0,
                                plotDT[round == 1, time_spent %>% mean() %>% round(digits=0)],
                                plotDT[round == 2, time_spent %>% mean() %>% round(digits=0)],
                                plotDT[round == 7, time_spent %>% mean() %>% round(digits=0)],
                                plotDT[round == 12, time_spent %>% mean() %>% round(digits=0)])) +
  labs(y = "Response Time in Seconds", caption = "Bars indicate 95% confidence intervals.
\nOutliers (identified by 99.0 quantile) removed.")

rm(list = c("tmp", "timeSpent", "duration", "plotDT", "pkgs"))

Figure 8.1: Average response time of the 12 ambiguity tasks of the full sample (1505 observations; outliers removed as described in the figure).

8.3 Figure OA.2

ggplot(data = raw[nchar(participant.label) == 32 & session.is_demo == 0 & participant._index_in_pages < 20],
       aes(x=participant._index_in_pages)) + 
  geom_hline(yintercept = 0) +
  geom_histogram(binwidth = 1, 
                 fill = colors[2])  +
  scale_y_continuous(limits = c(0, NA), expand = c(0, 0)) +
  # scale_y_log10(breaks=c(0, 1, 2, 3, 4, 5, 10, 100), expand = c(0, NA)) +
  layout +
  labs(x = "Pages") +
  scale_x_continuous(breaks = c(2),
                     labels = c("Instructions")) +
  labs(y = "Count", x = "Pages")

Figure 8.2: Dropout participants of the experiment by page number.

raw[Intro.1.player.location == "Ilomantsi", 
    conditions := paste0("contrad.-",
                         str_replace_all(string = Intro.1.player.treatment, 
                                         pattern = "_", 
                                         replacement = " "))]

raw[Intro.1.player.location == "Weiskirchen", 
    conditions := paste0("conf.-",
                         str_replace_all(string = Intro.1.player.treatment, 
                                         pattern = "_", 
                                         replacement = " "))]

ggplot(raw[participant._index_in_pages > 8 & nchar(participant.label) == 32 & session.is_demo == 0 & participant._index_in_pages < 20],
       aes(x  = conditions)) + 
  geom_hline(yintercept = 0) +
  geom_bar(fill = colors[2])  +
  scale_y_continuous(limits = c(0, NA), expand = c(0, NA)) +
  layout +
  labs(x = "Treatments", y = "Count") 

Figure 8.3: Dropout participants by treatment after introduction of the treatment.

Session Info

sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin20
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Zurich
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.5.1     Rmisc_1.5.1       plyr_1.8.9        lattice_0.22-6   
[5] stringr_1.5.1     data.table_1.15.4 magrittr_2.0.3   

loaded via a namespace (and not attached):
 [1] gtable_0.3.5      jsonlite_1.8.8    dplyr_1.1.4       compiler_4.4.1   
 [5] tidyselect_1.2.1  Rcpp_1.0.13       parallel_4.4.1    scales_1.3.0     
 [9] yaml_2.3.10       fastmap_1.2.0     R6_2.5.1          labeling_0.4.3   
[13] generics_0.1.3    knitr_1.48        htmlwidgets_1.6.4 tibble_3.2.1     
[17] munsell_0.5.1     pillar_1.9.0      rlang_1.1.4       utf8_1.2.4       
[21] stringi_1.8.4     xfun_0.46         cli_3.6.3         withr_3.0.1      
[25] digest_0.6.36     grid_4.4.1        rstudioapi_0.16.0 lifecycle_1.0.4  
[29] vctrs_0.6.5       evaluate_0.24.0   glue_1.7.0        farver_2.1.2     
[33] groundhog_3.2.0   fansi_1.0.6       colorspace_2.1-1  rmarkdown_2.27   
[37] tools_4.4.1       pkgconfig_2.0.3   htmltools_0.5.8.1